TIMX 515 - static DuckDB file prep#154
Merged
Merged
Conversation
Why these changes are being introduced: As we prepare for expanding the role of dataset metadata, which may be stored as a static file in S3 next to the dataset, it will be helpful to test and develop against a realistic S3 backdrop but do so locally. How this addresses that need: Configures pyarrow and DuckDB to create appropriate connections when a 'MINIO_S3_ENDPOINT_URL' env var is present. Side effects of this change: * None Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/TIMX-515
7966652 to
e1fb022
Compare
Pull Request Test Coverage Report for Build 16269288984Details
💛 - Coveralls |
Why these changes are being introduced: While PRAGMA configurations worked for direct parquet file reading in a local MinIO S3 instance, it did not work for DuckDB ATTACH statements. How this addresses that need: By using a DuckDB secret, setting the MinIO S3 endpoint and credentials there, other statments like ATTACH work as expected. This is overall a better approach anyways! The PRAGMA approach seemed like the only option originally, but this edge case of ATTACH forced revisiting it and this use of secrets does in fact work. Side effects of this change: * None Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/TIMX-515
jonavellecuerdo
approved these changes
Jul 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose and background context
This PR adds support for a local MinIO S3 instance as prep work for the more involved work in TIMX-515.
As we begin to explore the management of a static file in S3, it will be handy to have easy pathways for more local dev and testing while still getting the constraints and edge cases of AWS S3.
Additionally, renamed the attached
TIMDEXDatasetMetadatainstance onTIMDEXDatasetto just.metadata, inline with potentially more common and frequent usage.There is no dedicated ticket for this work, just some prep work.
How can a reviewer manually see the effects of these changes?
1- Set the following env vars:
2- Run MinIO server and create structure:
admin/passwordtimdex3- Start ipython shell:
4- Write some data to the empty dataset, confirming writes to MinIO work:
5- Reload the dataset with current records only, triggering the use of
TIMDEXDatasetMetadataand run a couple of metadata queries, demonstrating that reading files from MinIO works forpyarrowforTIMDEXDatasetloading and via DuckDB forTIMDEXDatasetMetadataqueries:These operations demonstrate that the MinIO S3 instance is successfully used for read/write operations, from both
pyarrowandDuckDB.Includes new or updated dependencies?
NO
Changes expectations for external applications?
NO
What are the relevant tickets?